

<template>
  <div class="home">
    <div class="home_top">
      <img
        src="../../assets/小U商城素材/icon/user/function/address.png"
        alt=""
        class="top_address"
      />
      <img
        src="../../assets/小U商城素材/pic/logo/white.png"
        alt=""
        class="top_white"
      />
      <van-cell-group>
        <van-field
          v-model="content"
          clearable
          left-icon="search"
          placeholder="按内容搜索"
        />
      </van-cell-group>
      <img
        src="../../assets/小U商城素材/icon/shortcut/commodify/store.png"
        alt=""
        class="top_store"
      />
    </div>
    <ul class="home-ul">
      <li class="ul-li">推荐</li>
      <li>女装</li>
      <li>鞋包</li>
      <li>居家</li>
      <li>母婴</li>
      <li>美妆</li>
      <span class="ul_span"></span>
    </ul>
    <!-- 轮播图 -->
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item><img src="../../assets/小U商城素材/banner/index/beside.png" alt="" class="banner_bes"></van-swipe-item>
      <van-swipe-item><img src="../../assets/小U商城素材/banner/index/mid.png" alt="" class="banner_bes"></van-swipe-item>
    </van-swipe>
    <!-- nav -->
    <div class="home_nav">
      <div class="nav_div">
        <img src="../../assets/小U商城素材/icon/index/kingkong/seckill.png" alt="" class="nav_img">
        <p class="nav_text">限时秒杀</p>
      </div>
      <div class="nav_div">
        <img src="../../assets/小U商城素材/icon/index/kingkong/top.png" alt="" class="nav_img">
        <p class="nav_text">畅销商品</p>
      </div>
      <div class="nav_div">
        <img src="../../assets/小U商城素材/icon/index/kingkong/brand.png" alt="" class="nav_img">
        <p class="nav_text">品质大牌</p>
      </div>
      <div class="nav_div">
        <img src="../../assets/小U商城素材/icon/index/kingkong/selfsupport.png" alt="" class="nav_img">
        <p class="nav_text">小U自营</p>
      </div>
      <div class="nav_div">
        <img src="../../assets/小U商城素材/icon/index/kingkong/integral.png" alt="" class="nav_img">
        <p class="nav_text">积分商城</p>
      </div>
    </div>

    <!-- 限时秒杀 -->
    <div class="limited">
        <div class="limited_left">
          <div class="left_h"><h6>限时秒杀</h6><span class="left_span">查看更多></span></div>
          <p class="left_text">每天0点场，好货秒不停</p>
          <div class="left_date">
              <span class="left_span">05</span>:<span class="left_span">20</span>:<span class="left_span">48</span>
          </div>
        </div>
        <div class="limited_right">
          <div class="right_top">
             <h6>品牌上新</h6>
             <p class="top_text">9点整，强大牌</p>
             <div class="top_div">疯抢红包&ensp;></div>
          </div>
          <div class="right_bottom">
            <h6>日用好物</h6>
             <p class="bottom_text">愿君多采频</p>
             <div class="bottom_div">塞满奖劵&ensp;></div>
          </div>
        </div>
    </div>

    <!-- 双11尖货 -->
     <div class="advance">
        <div class="advance_top">
          <span class="advance_left">双11尖货预购</span>
          <span>畅购全球</span>
        </div>
        <div class="advance_bottom">
            <img src="../../assets/小U商城素材/pic/commodity/01.png" alt="" class="advance_img">
            <img src="../../assets/小U商城素材/pic/commodity/02.png" alt="" class="advance_img">
            <img src="../../assets/小U商城素材/pic/commodity/03.png" alt="" class="advance_img">
            <img src="../../assets/小U商城素材/pic/commodity/04.png" alt="" class="advance_img">
        </div>
     </div>
  </div>
</template>

<script>
// @ is an alias to /src   
// import HelloWorld from '@/components/HelloWorld.vue'

export default {
  // name: 'HomeView',
  // components: {
  //   HelloWorld
  // }
  data() {
    return {
      banner:[],
      content: "", //输入框内容
    };
  },
  mounted(){
    // 轮播图
    this.getBanner()
  },
  methods: {
    getBanner(){
      this.$api.reqGetBanner().then(res=>{
        console.log(res);
      })
    }
  },
};
</script>

<style lang="scss" scoped>
//布局
.home_top {
  width: 100%;
  height: 60px;
  background: #ff6040;
  display: flex;
  justify-content: space-around;
  align-items: center;
  .top_address {
    background: #fff;
  }
  .top_white {
    width: 130px;
    height: 30px;
  }
}
.van-cell {
  padding: 0;
  padding-left: 5px;
  width: 160px;
  height: 33px;
  display: flex;
  align-items: center;
}
.home-ul {
  width: 100%;
  height: 30px;
  color: #fff;
  background: #ff8374;
  font-size: 14px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: relative;
  .ul-li {
    font-weight: 700;
    font-size: 16px;
  }
  .ul_span {
    position: absolute;
    left: 23px;
    bottom: 0.5px;
    display: block;
    width: 20px;
    height: 2px;
    background-color: #fff;
    border-radius: 5px;
  }
}
.banner_bes{
  width: 100%;
  height: 100%;
}
.home_nav{
  width: 100%;
  display: flex;
  justify-content: space-around;
  margin: 10px 0;
  .nav_div{
    text-align: center;
    .nav_img{
      width: 30px;
      height: 30px;
    }
    .nav_text{
      color: #999;
      font-size: 12px;
    }
  }
}
.limited{
  width: 100%;
  height: 175px;
  display: flex;
  padding:0 8px;
  .limited_left{
    width: 175px;
    height: 100%;
    background-image: url(../../assets/小U商城素材/pic/plate/index/kingkong/big.png);
    background-repeat: no-repeat;
    background-size: 175px 175px;
    .left_date{
      padding: 0 12px;
      color: #89a947;
      .left_span{
        display: inline-block;
       background-color: #89a947;
        font-weight: 700;
        font-size: 16px;
        padding: 2px;
        color: #fff;
      }
    }
    .left_text{
      font-size: 12px;
      color: #a5bc75;
      padding: 0 12px;
    }
    .left_h{
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 12px;
      h6{
        color:#a5bc75;
      }
      .left_span{
        font-size: 12px;
        color: #999;
      }
    }
  }
  .limited_right{
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 5px;
    .right_top{
      width: 100%;
      height: 85px;
      background-image: url(../../assets/小U商城素材/pic/plate/index/kingkong/small.png);
      padding-left: 12px;
      padding-top: 8px;
      h6{
        color: #ff6747;
      }
      .top_text{
        font-size: 12px;
        color: #f3968b;
        margin-top: 6px;
      }
      .top_div{
        color: #fff;
        background: #ff6b4b;
        width: 80px;
        height: 23px;
        line-height: 23px;
        text-align: center;
        font-size: 14px;
        border-top-left-radius: 2px;
        border-bottom-left-radius: 2px;
        border-top-right-radius: 12.5px;
        border-bottom-right-radius: 12.5px;
      }
    }
    .right_bottom{
      width: 100%;
      height: 85px;
      background-image: url(../../assets/小U商城素材/pic/plate/index/kingkong/small/02.png);
      margin-top: 5px;
      padding-left: 12px;
      padding-top: 8px;
      h6{
        color: #b94aff;
      }
      .bottom_text{
        font-size: 12px;
        color: #cb93ee;
        margin-top: 6px;
      }
      .bottom_div{
        color: #fff;
        background: #b94aff;
        width: 80px;
        height: 23px;
        line-height: 23px;
        text-align: center;
        font-size: 14px;
        border-top-left-radius: 2px;
        border-bottom-left-radius: 2px;
        border-top-right-radius: 12.5px;
        border-bottom-right-radius: 12.5px;
      }
    }
  }
}
.advance{
  width: 100%;
  margin-top: 10px;
  .advance_top{
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 14px;
    color: #999;
    .advance_left{
      font-weight: 700;
      font-size: 16px;
      color: #ff6040;
    }
  }
  .advance_bottom{
    width: 100%;
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
    padding: 0 8px;
    .advance_img{
      width: 86px;
      height: 86px;
    }
  }
}
</style>